﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataKeyCode : MetadataSingleArgumentSuffix<StringLiteral>
{
    internal MetadataKeyCode(SyntaxToken keyCodeKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataKeyCode,
            keyCodeKeywordToken,
            NodeConverter.ToIdentifier(keyCodeKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataKeyCode CreateMetadataKeyCode(SyntaxNode? parent, SyntaxToken keycodeKeywordToken,
        StringLiteral? value)
    {
        Debug.Assert(keycodeKeywordToken.IsNode(SyntaxKinds.KeycodeKeywordToken));
        MetadataKeyCode keycode = new(keycodeKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(keycode, value);
    }
}